<!DOCTYPE html>
<html>
<head>
    <title>原料档案</title>
    {% include 'system/common/header.html' %}
</head>
<body>
<form class="layui-form">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">

                <div class="layui-form-item">
                    <label class="layui-form-label">品名</label>
                    <div class="layui-input-block">
                        <input type="text" name="品名" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">默认规格</label>
                    <div class="layui-input-block">
                        <input type="text" name="默认规格" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">默认产地</label>
                    <div class="layui-input-block">
                        <input type="text" name="默认产地" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">代码</label>
                    <div class="layui-input-block">
                        <input type="text" name="代码" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">执行标准</label>
                    <div class="layui-input-block">
                        <input type="text" name="执行标准" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">检验标准</label>
                    <div class="layui-input-block">
                        <input type="text" name="检验标准" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">
                        <input type="radio" name="状态" value="1" title="开启">
                        <input type="radio" name="状态" value="0" title="关闭" checked>
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">版本号</label>
                    <div class="layui-input-block">
                        <input type="text" name="版本号" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" value="1">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">工艺验证</label>
                    <div class="layui-input-block">
                        <input type="radio" name="工艺验证" value="1" title="是">
                        <input type="radio" name="工艺验证" value="0" title="否" checked>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">归属类别</label>
                    <div class="layui-input-block">
                        <input type="text" name="归属类别" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">贮存条件</label>
                    <div class="layui-input-block">
                        <input type="text" name="贮存条件" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">药典贮存条件</label>
                    <div class="layui-input-block">
                        <input type="text" name="药典贮存条件" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" value="">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <input type="text" name="备注" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">性味与归经</label>
                    <div class="layui-input-block">
                        <input type="text" name="性味与归经" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">功能与主治</label>
                    <div class="layui-input-block">
                        <input type="text" name="功能与主治" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">用法与用量</label>
                    <div class="layui-input-block">
                        <input type="text" name="用法与用量" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">注意事项</label>
                    <div class="layui-input-block">
                        <input type="text" name="注意事项" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">拉丁文</label>
                    <div class="layui-input-block">
                        <input type="text" name="拉丁文" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">采收时间</label>
                    <div class="layui-input-block">
                        <input type="text" name="采收时间" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">初加工方法</label>
                    <div class="layui-input-block">
                        <input type="text" name="初加工方法" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">质量要求</label>
                    <div class="layui-input-block">
                        <input type="text" name="质量要求" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">保质期</label>
                    <div class="layui-input-block">
                        <input type="text" name="保质期" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" value="24">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">安全库存天数</label>
                    <div class="layui-input-block">
                        <input type="text" name="安全库存天数" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" value="45">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">自定义安全库存</label>
                    <div class="layui-input-block">
                        <input type="text" name="自定义安全库存" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" value="0">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">养护内容</label>
                    <div class="layui-input-block">
                        <input type="text" name="养护内容" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">税率</label>
                    <div class="layui-input-block">
                        <input type="text" name="税率" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                               class="layui-input" value="9">
                    </div>
                </div>




            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="user-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="pear-btn pear-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
{% include 'system/common/footer.html' %}
<script>
  layui.use(['form', 'jquery'], function () {
    let form = layui.form
    let $ = layui.jquery
    var laydate = layui.laydate;

      // 渲染
     laydate.render({
        elem: '#ID-laydate-demo'
      });
    form.on('submit(user-save)', function (data) {
      let roleIds = ''
      $('input[type=checkbox]:checked').each(function () {
        roleIds += $(this).val() + ','
      })
      roleIds = roleIds.substr(0, roleIds.length - 1)
      data.field.roleIds = roleIds

      $.ajax({
        url: '/goodsfiles/finished/yp/save',
        data: JSON.stringify(data.field),
        dataType: 'json',
        contentType: 'application/json',
        type: 'post',
        success: function (result) {
          if (result.success) {
            layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
              parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
              parent.layui.table.reload('user-table')
            })
          } else {
            layer.msg(result.msg, { icon: 2, time: 1000 })
          }
        }
      })
      return false
    })
  })
</script>
<script>
</script>
</body>
</html>